import qs from 'qs'
const logList = [
  {logId: 1, logType: 0, logModule: '基础操作', oldValue: '', newValue: '', createTime: '2020-05-20 20:20:20', logDesc: 'XXX登录系统，上一次登录时间:XXXX-XX-XX XX:XX:XX', relId: '1', batchFlag: 0, returnFlag: 0, okFlag: 1, failMsg: '', operatorName: '周大侠'},
  {logId: 2, logType: 2, logModule: '菜单管理', oldValue: '', newValue: 'test', createTime: '2020-05-20 20:20:20', logDesc: '新增菜单Id[XXXXXXXXX]名称[测试管理]', relId: '01', batchFlag: 0, returnFlag: 0, okFlag: 1, failMsg: '', operatorName: '周大侠'},
  {logId: 3, logType: 2, logModule: '菜单管理', oldValue: 'test', newValue: 'test', createTime: '2020-05-20 20:23:20', logDesc: '修改菜单Id[XXXXXXXXX]名称[测试管理]', relId: '001', batchFlag: 0, returnFlag: 0, okFlag: 1, failMsg: '', operatorName: '周大侠'}
]

export default {
  'get|/monitor/log/list': option => {
    let ret = {code: 200, msg: '', data: null}
    const url = option.url
    const params = url.split('?')[url.split('?').length - 1]
    const query = qs.parse(params)
    // 前端不做条件查询
    console.log(query)
    const data = {
      total: logList.length,
      dataList: logList
    }
    ret.data = data
    return ret
  }
}
